<%@page contentType="text/html"%>
<%@page pageEncoding="GBK"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript">
function User()
{
	var f=document.form1;
	if(f.Password.value=="")
        {
               alert("Old password can't empty");
               f.Password.focus();
                f.Password.select();
		return false;
        }
        if(f.Password.value.length>16 || f.Password.value.length<6)
	{	
		alert("Old password is too short");
                f.Password.focus();
                f.Password.select();
		return false;
		
	}
        if(isNaN(f.Password.value))
        {
                alert("Old password must be number");
                f.Password.focus();
                f.Password.select();
                return false;
                
        }
        
        
      if(f.Password1.value=="")
        {
               alert("new password can't empty");
               f.Password1.focus();
                f.Password1.select();
		return false;
        }
        if(f.Password1.value.length>16 || f.Password.value.length<6)
	{	
		alert("new password is too short");
                f.Password1.focus();
                f.Password1.select();
		return false;
		
	}
        if(isNaN(f.Password1.value))
        {
                alert("new password must be number");
                f.Password1.focus();
                f.Password1.select();
                return false;   
        }
      if(f.Password1.value!=f.Password2.value)
	{
		alert("Password are not the same!");
                f.Password2.focus();
                f.Password2.select();
		return false;
	}
       
      
 
}
</script>
<body>
<p align="center" class="style1">PIM</p>
<hr>
<p>&nbsp;</p>
<table width="644" height="26" border="2" align="center" cellpadding="1" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#CDE9FE">
  <tr>
    <td><div align="center"><a href="index.html">Homepage</a></div></td>
    <td><div align="center"><a href="ModifySerlvet?param=0">Edit Personal Information</a></div></td>

    <td><div align="center">Password Modification</a></div></td>
    <td><div align="center"><a href="DestineServlet?param=1">Plane Reservation</a></div></td>
    <td><div align="center"><a href="ExamineSerlvet">Check shopping cart</a></div></td>
    <td><div align="center"><a href="index.html">Exit</a></div></td>
  </tr>
</table>
<p>&nbsp;</p>
<form name="form1" method="post" action="PassServlet" onsubmit="return User()">
    <p>&nbsp;</p>
    <table width="300" border="1" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="94" height="38"><div align="center"><p>Old password</p> </div></td>
        <td width="200"><div align="center"><input name="Password" type="password"  size="20" />
        </div></td>
      </tr>
      <tr>
        <td height="38"><div align="center">New password</div></td>
        <td><div align="center"><input name="Password1" type="password"  size="20" >     
        </div></td>
      </tr>
      <tr>
        <td height="38"><div align="center">Make sure the password</div></td>
        <td><div align="center"> <input name="Password2" type="password" size="20" >
        </div></td>
      </tr>
      <tr>

    </table>
    <p align="center">
      <input type="submit" name="Submit" value="Modification"/>&nbsp;&nbsp;&nbsp;
      <input type="reset" name="reset" value="Replacement"/>
   
    
</p>
  </form>
</body>
</html>

